package com.edais.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.edais.domain.GetUserInfo;
import com.edais.domain.IcoUserFuncInfo;
import com.edais.domain.NoticeInfo;
import com.edais.domain.UnbindingCardApply;
import com.edais.domain.User;
import com.edais.domain.UserAccountDetail;
import com.edais.domain.UserInfo;
import com.edais.domain.UserRecePayCard;
import com.yunzhi.domain.RequestHeader;
import com.yunzhi.domain.ResultDTO;

@Service

public interface UserService {
	List<GetUserInfo> loginCheck(String mobile, String password, String type) throws Exception;

	// void addUser(User user);
	//
	// void addUserInfo(UserInfo userInfo);

	void addUsers(User user) throws Exception;

	void resetPsw(String mobile, String newPsw, String type)
			throws Exception;

	void resetPswCash(String mobile, String newPsw, String type)
			throws Exception;

	User getUserByParm(Map<String, Object> map) throws Exception;

	User getUserDetail(String userID) throws Exception;
	
	UserAccountDetail getUserAccountDetail(String userID) throws Exception;

	void resetPswById(String newPsw, String userID, String oldPsw) throws Exception;
	
	UserInfo getUserInfo(String userId) throws Exception;
	
	void saveRandomCode(String mobileNum,String randomCode,String type) throws Exception;
	
	void updateToBeLender(String allowLend,String userId) throws Exception;
	
	int getUserNotMeByInviteCode(String invitationCode, String id) throws Exception;
	
	int getInviteCodeCount(String invitationCode) throws Exception;
	
	void updateInvitationCode(String invitationCode,String userId) throws Exception;
	
	Map<String, Object> getUserMobile(String userId) throws Exception;
	
	User getInviterInfo(String invitationCode) throws Exception;

	/**
	 * 更改头像
	 * @throws Exception
	 */
	Map<String, Object> modifySculpture(MultipartFile imageFile,String userId,String logInfo) throws Exception;

	void doLogin(Map<String,String> map) throws Exception;
	
	int checkIdCardIsExist(Map<String,Object> map) throws Exception;
	
	String sendSmsW(HttpServletRequest request, Map<String, String> pMap)
			throws Exception;
	
	
	
	
	
	
	/**
	 * 手机是否存在检查 
	 * @param mobile
	 * @return
	 * @throws Exception
	 */
	int phoneIsExisted(String mobile) throws Exception ;
	
	/**
	 * 获取验证码
	 * @param map
	 * @param infoTime 
	 * @return
	 * @throws Exception
	 */
	ResultDTO getCaptcha(JSONObject map, String infoTime) throws Exception;
	
	/**
	 * 校验证码
	 * @param params
	 * @return
	 * @throws Exception
	 */
	ResultDTO checkCaptcha(JSONObject params) throws Exception;
	
	/**
	 * 登陆
	 * @param params
	 * @return
	 * @throws Exception
	 */
	ResultDTO dealLogin(JSONObject params) throws Exception;

	/**
	 * WX登陆
	 * @param map
	 * @return
	 * @throws Exception
	 */
	String dealLoginByWx(Map<String, String> map) throws Exception;

	/**
	 * 连连支付-实名认证
	 * @param map
	 * @return
	 */
	Map<String, Object> getAuth(Map<String, String> map)throws Exception;
	/**
	 * 铃铛双十一添加用户
	 * @param user
	 * @throws Exception
	 */
	void ldAddUsers(User user,boolean flg) throws Exception;
	/**
	 * 铃铛双十一活动-查询用户活动信息
	 * @param map
	 * @return
	 */
	
	 Map<String, Object> findUserActivityInfo(Map<String, String> map);
	
	/**
	 * 获取系统参数 通过NAME
	 * @param String
	 * @return
	 */
	String getSystemSettingValue(String keyName) throws Exception;
	
	/**
	 * 根据特定的name得到参数表中对应的协议编号
	 * @param String
	 * @return
	 */
	List<Map<String, String>>  getSysSettByAgreementNo() throws Exception;
	
	/**
	 * 根据userId获取用户主账户
	 * @param map
	 * @return
	 */
	 Map<String, Object> findCusAcctInfo(String id) throws Exception;

	 /**
		 * app滚动公告信息取信息system_setting
		 * @param map
		 * @return
		 * @throws Exception 
		 */
	public NoticeInfo getSystemSettingInfo(Map<String, Object> map) throws Exception;

	/***
	 * 删除微信userid绑定关系
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	int deleteWeixinBingding(String userId) throws Exception;
	/***
	 * 检查密码
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	String checkPassword(Map<String, String> paramsMap) throws Exception;
	
	/**
	 * 判断用户是否存在活期订单
	 * @param userId
	 * @return
	 */
	boolean isExistOrderInfo(String userId)  throws Exception;
	
	/**
	 *  根据身份证号和手机号查询是否存在信息
	 * @param map
	 * @return
	 */
	ResultDTO<String> queryUserInfoByIDCardAndMobile(JSONObject params)throws Exception; 
	
	
	/**
	 * 查询交易密码相关信息
	 * @param mobile
	 * @param passwordCash
	 * @param checkFlag
	 * @return
	 */
	Map<String,Object> queryPasswordCashInfo(String mobile,String passwordCash,String checkFlag)  throws Exception;
	
	/**
	 * 核心增加铃铛用户
	 * @param user
	 * @return
	 */
	Map<String,Object> coreLDAddUser(User user,boolean flg)  throws Exception;

	/**
	 * 密码登录
	 * @param params
	 * @return
	 * @throws Exception
	 */
	ResultDTO dealLoginPassWord(JSONObject params) throws Exception;
	
	/**
	 * 查询当前手机号每天只能修改五次
	 * @param paramsMap
	 * @param infoTime 
	 * @return
	 * @throws Exception
	 */
	Map<String, String> judgeCaptchaTime(Map<String, String> paramsMap, String infoTime) throws Exception;

	/**
	 *  查询任务列表
	 * @param userId 
	 * @return
	 * @throws Exception
	 */
	JSONArray getTaskList(String userId) throws Exception;
	/**
	 * 查询总菜单功能定制表数据
	 * @param userId
	 * @return
	 */
	List<IcoUserFuncInfo> getAllIcoFuncList(String viewFlag) throws Exception;
	
	/**
	 * 查询个人菜单功能定制表数据
	 * @param requestMap
	 * @return
	 */
	List<IcoUserFuncInfo> getUserIcoFuncList(String userId) throws Exception;

	/**
	 * 发布个人菜单功能定制表数据
	 * @param userId
	 * @return
	 */
	void addUserIcoFuncList(Map<String,String> requestMap) throws Exception;

	
	/**
	 * 删除个人菜单功能定制表数据
	 * @param userid
	 */
	void deleteUserIcoFuncSort(String userid) throws Exception;
	
	/**
	 *通过参数查询总菜单功能定制表数据
	 * @param userId
	 * @param viewFlag 
	 * @return
	 */
	List<IcoUserFuncInfo> getAllIcoFuncListByParams(String userId, String viewFlag)throws Exception;

	/**
	 * 获取参数表配置的html内容
	 * @param name 
	 * @return
	 * @throws Exception
	 */
	String getSysSettingHtmlInfo(String name)throws Exception;
	
	void insertUserQuickWithdrawInfo(String userId) throws Exception;

	/**
	 *取得菜单功能定制表数据（更多）
	 * @param userId
	 * @param viewFlag 
	 * @return
	 */
	IcoUserFuncInfo getIcoFuncGd() throws Exception;
	
	void unbindingCard(UserRecePayCard userRecePayCard, UnbindingCardApply newApply);
	
	/***
	 * 检查密码
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	Map<String, Object> checkLoginPWD(Map<String, String> paramsMap) throws Exception;

	/**
	 *通过参数查询总菜单功能定制表数据(老版本)
	 * @param userId
	 * @return
	 */
	List<IcoUserFuncInfo> getAllIcoFuncListOld(String userId);

	/**
	 *查询默认总菜单功能定制表数据(老版本)
	 * @param userId
	 * @return
	 */
	List<IcoUserFuncInfo> getAllIcoFuncListDefaultOld();

	/**
	 * 实名认证当日次数是否超限
	 * @param map
	 * @return map
	 */
	Map<String, Object> authLimitValidate(Map<String, Object> map) throws Exception;
	
	/**
	 * 连连支付-实名认证新接口
	 * @param map
	 * @param user
	 * @return map
	 */
	Map<String, Object> getAuthNew(Map<String, Object> map,User user,String logInfo) throws Exception ;
	
	/**
	 * 实名认证校验
	 * @param idCard
	 * @param idCardValidate
	 * @return map
	 */
	Map<String, Object> idCardValidate(String idCard,String idCardValidate)throws Exception ;

	/**
	 * 查询用户
	 * @param id				主键
	 * @param mobile		手机号
	 * @return					用户
	 */
	User selectUser(Long id,String mobile)  throws Exception ;

	/**
	 * 获取数据库系统时间
	 * @return
	 * @throws Exception
	 */
	Date getSysdate();
	
	/**
     * 提示信息接口
     * @param params
     * @return
     * @throws Exception 
     */
    ResultDTO promptInfo(JSONObject params, RequestHeader header) throws Exception;

	/**
	 * 验证密码
	 * @param params				参数列表
	 * @param header
	 * @return	结果
	 */
	ResultDTO validPasswd(JSONObject params, RequestHeader header) throws Exception;

	/**
	 * 查询快捷菜单项
	 * @param id
	 * @return
	 */
	IcoUserFuncInfo queryIcoFuncInfo(Long id)throws Exception;
}
